package com.cskaoyan.service.wx;

import com.cskaoyan.bean.GoodsExample;
import com.cskaoyan.bean.OrderExample;
import com.cskaoyan.bean.vo.WxUserOrderIndex;
import com.cskaoyan.mapper.GoodsMapper;
import com.cskaoyan.mapper.IndexMapper;
import com.cskaoyan.mapper.OrderMapper;
import org.aspectj.weaver.ast.Or;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 杨杰
 * @version V1.0
 * @Package com.cskaoyan.service.wx
 * @date 2020/12/9 10:55
 * @Copyright © 暂时还没有
 * @description
 */
@Service
public class WxUserServiceImp implements WxUserService{

    @Autowired
    IndexMapper indexMapper;


    @Override
    public WxUserOrderIndex queryUserOrderIndex(Integer userId) {

        WxUserOrderIndex order = new WxUserOrderIndex();

        //根据id查询四种状态的货物数量
        order.setUnpaid(indexMapper.queryStatusOrderNum(userId, 100,200));
        order.setUnship(indexMapper.queryStatusOrderNum(userId,200,300));
        order.setUnrecv(indexMapper.queryStatusOrderNum(userId,300,400));
        order.setUncomment(indexMapper.queryStatusOrderNum(userId,400,500));

        System.out.println(order.toString());

        return order;
    }
}
